<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<meta HTTP-EQUIV="EXPIRES" CONTENT="0">
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="data/css/global.css" type="text/css">
<script type="text/javascript" src="data/js/jquery-1.2.6.js"></script>
<title>Saahas WMS | Login</title>

<script>
   function validate() {
      var status = true;
      var fields = $("input[@type!='submit']").filter(function() {
         if (jQuery.trim(this.value).length == 0 && status)
         {
            alert('Both Username & Password need to be filled.');
            status = false;
            this.focus();
         }
      });

      return status;
   }
</script>
</head>
<body>
   <center>
   
   <div style="padding:3px; border: 3px solid #6184BD; height:300px; 
      width: 400px; margin-top:110px; background: url(data/images/pattern.gif);">
      <div style=" border: 3px solid #A2DC72; padding: 5px; margin: 40px 0 30px 0;
         background-color: #fff;">
         <img src="data/images/s_logo.png"  style="margin-top: 15px;"/> 
         <br/>
         <div class="textBold_12" style="margin-bottom: 25px;">
            Waste Management System
         </div>
         <div>
            <form name="loginForm" action="login.shs" method="post" onsubmit="javascript: return validate();">
               <input type="hidden" name="impl" value="validate"/>
               <table width="60%">
                  <tr>
                     <td class="textNormal_12">
                        Username
                     </td>
                     <td>
                        <input type="text" name="username" size="25" class="textInputNormal_12"
                          autocomplete="false"/>
                     </td>
                  </tr>
                  <tr>
                     <td class="textNormal_12">
                        Password
                     </td>
                     <td>
                        <input type="password" name="password" size="25" 
                           class="textInputNormal_12"/>
                     </td>
                  </tr>
                  <tr>
                     <td colspan="2" align="center">
                        <input type="submit" value=" Login "  class="textNormal_12"/>
                     </td>
                  </tr>
               </table>
            </form>
         </div>
      </div>
   </div>
   <c:if test="${user != null}">
      <c:choose>
         <c:when test="${user.error}">
            <c:set var="className" value="errDiv"/>
         </c:when>
         <c:otherwise>
            <c:set var="className" value="npDiv"/>
         </c:otherwise>
      </c:choose>
      <div class="${className} textNormal_12" style="width: 300px; padding-left: 25px; margin-top: 10px;">
         ${user.message}
      </div>
   </c:if>
   
   </center>
   <script>
      var Form = document.loginForm;
      Form.username.focus();
   </script>
</body>
</html>